<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html> 
<html> 
<head>
	<meta charset="UTF-8">
	<%@ include file="../include/easyui.jsp" %>
	<title>登录-通信工程管理系统</title>
	<script type="text/javascript" src="${path}/plug-in/layui/layui.js"></script>
	<script type="text/javascript" src="${path}/plug-in/other/jquery.particleground.min.js"></script>
	<link rel="stylesheet" href="${path}/plug-in/layui/css/layui.css" />
	<style type="text/css">
		html,body{height: 100%;width: 100%;margin:0;padding:0;}  
		.layui-form-item .input-custom-width {width: 250px;text-align: center; margin-left: 9%;}
		.login_page{background-color: #fff;font-family: "open sans","Helvetica Neue",Helvetica,Arial,sans-serif;height:200px;width:300px;text-align: center;margin:14% auto 0 auto;padding-top:70px;box-shadow: 0 -12px 30px #B7BFBA;border-radius: 5px;}
		.login_page h1{font-size: 20px;color: #676a6c;margin-bottom:20px;margin-top: -35px;}
		.login_page .layui-form{width:300px;display: inline-block;margin:0 auto;}
		body{  
		    background:url(../images/login3.jpg)no-repeat;  
		    width:100%;  
		    height:100%;  
		    background-size:100% 100%;  
		    position:absolute;  
		    overflow:hidden;
		    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/login3.jpg',sizingMethod='scale');  
		}  
		.forminput{border-radius:8px; border:1px solid #DBDBDB ;}
	</style>
</head>

<body>
	<div class="login_page">
		<h1><b>登录</b></h1>
		<form class="layui-form">
			<div class="layui-form-item">
				<div class="layui-input-inline input-custom-width">
					<input type="text"  name="loginAccount" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input forminput"></input>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-inline input-custom-width">
					<input type="password"  name="loginPwd" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input forminput"></input>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-inline" style="margin-left: 3%">
					<button class="layui-btn layui-btn-radius input-custom-width" lay-submit="" lay-filter="login">立即登陆</button>
				</div>
			</div>
		</form>
	</div>
<script>
layui.use('form', function() {
	var form = layui.form, jq = layui.jquery;
	//监听提交
	form.on('submit(login)', function(data) {
		loading = layer.load(2, {
			shade : [ 0.2, '#000' ]
		//0.2透明度的白色背景
		});
		var param = data.field;
		jq.post('/console/login', param, function(data) {
			if (data.loginStatus == true) {
				layer.close(loading);
				layer.msg(data.loginResult, {
					icon : 1,
					time : 1000
				}, function() {
					location.href = '${path}/console?r='+Math.random();
				});
			} else {
				layer.close(loading);
				layer.msg(data.loginResult, {
					icon : 2,
					anim : 6,
					time : 1000
				});
			}
		});
		return false;
	});
});
</script>
</body>
</html>